import request from "@/utils/request";

// 查询需求信息列表
export function listDemand(query) {
  return request({
    url: "/demand/list",
    method: "get",
    params: query,
  });
}

// 查询需求信息详细
export function getDemand(demandId) {
  return request({
    url: "/demand/" + demandId,
    method: "get",
  });
}

// 新增需求信息
export function addDemand(data) {
  return request({
    url: "/demand",
    method: "post",
    data: data,
  });
}

// 修改需求信息
export function updateDemand(data) {
  return request({
    url: "/demand",
    method: "put",
    data: data,
  });
}

// 删除需求信息
export function delDemand(demandId) {
  return request({
    url: "/demand/" + demandId,
    method: "delete",
  });
}

export function toggleDemand(data) {
  return request({
    url: "/demand/updateStatus",
    method: "put",
    data,
  });
}

export const getPhoneCheckList = (params) => {
  return request({
    url: "/demand/mobileSearchLog",
    method: "get",
    params,
  });
};


export function toggleDemandIsTop(data) {
  return request({
    url: "/demand/updateRecommendStatus",
    method: "put",
    data,
  });
}
